﻿//-----------------------------------------------------------------------
// <copyright file="IocServiceProvider.cs" company="SLWY Enterprises">
// * Copyright (C) 2017 四川商旅无忧科技有限公司 版权所有。
// * version : 1.0
// * author  : qinchaoyue
// * FileName: IocServiceProvider.cs
// * history : created by qinchaoyue 2017-10-17 06:57:50
// </copyright>
//-----------------------------------------------------------------------

namespace Slwy.FrameCore.Dependency
{
    using System;

    /// <summary>
    /// 默认IoC服务提供者实现
    /// </summary>
    public class IocServiceProvider : IServiceProvider
    {
        private readonly IIocResolver resolver;

        public IocServiceProvider(IIocResolver resolver)
        {
            this.resolver = resolver;
        }

        public object GetService(Type serviceType)
        {
            return this.resolver.Resolve(serviceType);
        }
    }
}